Log In  
[back to top]

[ :: Read More :: ]

Cart #knutil_exrect-0 | 2023-04-24 | Code ▽ | Embed ▽ | No License
1

Feature Overview

EXRECT() creates a rectangle object with extended functionality.

  • The created rectangle object can be drawn and its inclusions and overlaps can be checked.
  • Drawing and update functions return their own objects, so they can be written in succession.
  • This function consumes 388 Token.(include comb() and cat() functions)
r = exrect('10 80 16 24') -- generate a rectangle object from a string. x:10, y:10, width:16, height:24
r.rf(6).rs(7) -- draw "r" with rectfill, and then draw it again with rect.

?r.con(13,80)  -- true
?r.con(9,80)  -- false

?r.con(exrect'12 82 8 8')  -- true
?r.con(exrect'9 82 8 8')  -- false

?r.hov(exrect'12 82 8 8')  -- true
?r.hov(exrect'9 82 8 8')  -- true

--Check the code for further applications!

This function is included in the KNUTIL library.

release note


v0.1

  • first release
P#128952 2023-04-24 10:24

[ :: Read More :: ]

In the code editor's search function, if you enter a search word and then double-click on the text, the search word is reset and you cannot use ctrl + G( or ctrl + H) to search for the next word.

P#127653 2023-03-27 10:05 ( Edited 2023-03-27 10:05)

[ :: Read More :: ]

Cart #p8ooccapture-7 | 2023-07-11 | Code ▽ | Embed ▽ | No License
8

Feature Overview

Capture the string for "One-off character" used in P8SCII from the sprite sheet and copy it to the clipboard.

  • Simply print() the copied string to draw an image like spr().
  • No decoder implementation is required.

!! Uses mouse control which does not work with BBS.

Please download and use it. !!

Type on your console

> load #p8ooccapture

Note: Turn on "PUNY FONT MODE" when pasting into the code.
Depending on the character, sound may be made or the display of raw characters may be corrupted.

I have made one in the past with fillp and rectfill for equivalent purposes(FILLPatDraw), and I believe P8OOCPrint will be lighter and faster performing than this.

Control method

↖mouse moving:
    move cursor

🎯ctrl/cmd key + mouse moving:
    grid movement

📏left button drag:
    capture size change

🧑‍🤝‍🧑ctrl/cmd + left button drag:
    change [*]MULTIPLE SELECTIONS

📜right button drag (space-bar):
    scroll screen

🌐ctrl/cmd + right button drag (space-bar):
    screen grid scrolling

🔍️mouse wheel:
    zoom in/out of screen

🖨️ctrl/cmd + c key
    one-off character captured in full color
    For [*]MULTIPLE SELECTIONS, a comma-separated string is output.

📰ctrl/cmd + shift + c key
    capture one-off character in silhouette

📋️enter
    open the pause menu
    - copy code: the sample code for drawing is in this.
    - custom font: encoding using custom fonts. custom font setup code is also copied to clipboard when captured.

**when printing a capture, it is recommended to specify coordinates.**

Printed samples of One-off characters

--** Add [\^.] to the copied CHARACTER and print(). **--

?"\^.\0\14\14>>>\0\0" -- Tilted Heart
?"\^.\0\0「\0B<\0\0" -- Smiling mouth
?"\^.ヲュ◜◝◝○?゜" -- Tilted crystal

Update history


v0.6.0

  • fix: changed some escape characters to one-character notation.(more compression)
  • fix: avoided a bug that caused an error if the coordinates of the click start were not taken.

v0.5.0

  • add: the functionto encode using custom fonts. set in the pause menu.
  • add: [ui] display horizontal and vertical numbers for multiple selections.
  • fix: avoided notation of adjacent control characters and numbers.

v0.4.0

  • add: support for repeating instructions "\*x" for duplicate patterns.
  • add: delete whitespace before line break.
  • add: [ui]color-coded sprite sheet range.
  • add: [ui]compressor initialization with message.
  • add: [ui]displays a guide cursor for range selection and multiple selections.
  • add: [ui]adjust the scroll range of the sprite sheet.
  • fix: [ui]adjustment of range and multiple selections.
  • fix: [ui]hide ui during selection operation.
  • fix: changed position display to 0-padding.
  • del: eliminated compression of inverted fills.

v0.3.0

  • add: support for single-character expressions by matching against default font patterns.
  • fix: substitution to split character codes 0~15 and numeric characters.
  • add: the most frequent patterns are selected as shortened characters. (default font supported)
  • add: instruction to turn off P8SCII's border background.

v0.2.0

  • add: supports grid movement.
  • add: sprite capture size change.
  • add: captures of multiple sprites at once.
  • add: support for drag-and-drop import of sprites.
  • add: copy of code for simple drawing to menu.
  • fix: conversion method of control codes "\0 \14 \15".
  • fix: add double quotation marks to the capture code

v0.1.0

  • first release.
P#127257 2023-03-17 06:50 ( Edited 2024-04-18 04:52)

[ :: Read More :: ]

Cart #strdsum-0 | 2023-02-02 | Code ▽ | Embed ▽ | No License
5

Feature Overview

STRDSUM() sums two numerable strings.

  • The number of digits it can handle exceeds the 32-bit limit. (Probably as long as the system will allow.)
  • Match the string length to the longer of the two arguments.
  • Negative values and values after the decimal point cannot be handled.(Insert a period in the output result.)
  • This function consumes 63 Token.

This code may cause errors in versions prior to 0.2.5c.

?strdsum('32768','32768') -- 65536

?strdsum('500','000500') -- 001000

?strdsum('900109','123456') -- 1023565
P#125166 2023-02-02 12:58 ( Edited 2023-05-13 11:59)

[ :: Read More :: ]

Hello @zep

One of my game players reported this.
It seems that Pico8 games downloaded from Steam sometimes fail to start when a controller is connected.

Target game in which the bug occurred.

https://store.steampowered.com/app/1448220/KONSAIRI/

Running environment

  • Apple silicon Mac.
  • Gamepad "Sony PlayStation® DualSense™ Wireless Controller" ----STORE PAGE.
  • Using Steam's controller linkage function (Bluetooth).
  • Exported cart pico8 version 0.2.2c (also occurs in 0.2.5e)

Crash report

https://docs.google.com/document/d/1u615ThHWhl_YEK8agfgb5EENnyzfXKkhnk_ach4XDgA/edit?usp=sharing

Thank you for your cooperation.

P#123735 2023-01-09 08:37

[ :: Read More :: ]

In the screenshot, the pause menu does not appear.

But in the case of GIF output, the pause menu seems to appear.
(version 0.2.5c)

P#59536 2022-12-09 12:06 ( Edited 2022-12-09 12:08)

[ :: Read More :: ]

Cart #knutil_bpack-0 | 2022-12-01 | Code ▽ | Embed ▽ | No License

Feature Overview

BPACK() pack the value of the bit specification with bit width.

  • By packs in the direction of low bits when multiple bit values are specified.
  • By setting [number s] to a negative value, bit pack can be started from the decimal point.
  • If there are fewer bit-width elements relative to the value to be packed, the bit-width elements are rotated.
  • This function consumes 37 Token.
v=bpack({8,4},0,0xff,0xb)
?tostr(v,1) -- 0x00ff.b000 (bit-left-shift:0)

v=bpack({8,4},8,0xff,0xb)
?tostr(v,1) -- 0xffb0.0000 (bit-left-shift:8)

This function is included in the KNUTIL library.

release note


v0.1

  • first release
P#59572 2022-12-01 13:18 ( Edited 2022-12-02 15:17)

[ :: Read More :: ]

Cart #knutil_bunpack-2 | 2022-11-30 | Code ▽ | Embed ▽ | No License
1

Feature Overview

BUNPACK() slice the value with bit width.

  • By specifying the argument after [number w], a value of up to 32 bits can be sliced.
  • By setting [number s] to a negative value, bit slice can be started from the decimal point.
  • This function consumes 30 Token.
a,b=bunpack(0xf8,4,4,4) -- Value, First bit-shift, bit-width, ...[bit-width]
?a -- 15 (0xf)
?b -- 8 (0x8)

This function is included in the KNUTIL library.

release note


v0.1

  • first release
P#121616 2022-11-30 12:12 ( Edited 2022-12-02 15:17)

[ :: Read More :: ]

Cart #knutil_tbfill-0 | 2022-09-12 | Code ▽ | Embed ▽ | No License
1

Feature Overview

TBFILL() Create a table by specifying an index number.

  • Create the table with the specified minimum and maximum indices and fill it with the value of the first argument.
  • Multi-dimensional tables can be created by adding minimum and maximum arguments.
  • This function consumes 30 Token.
-- one-dimensional table 
t=tbfill('yes',1,3)
?t[1]..' '..t[2]..' '..t[3].."\n\n"

-- two-dimensional table
t=tbfill('yes',1,2,1,3)
t[2][2]='no'
?t[1][1]..' '..t[1][2]..' '..t[1][3]
?t[2][1]..' '..t[2][2]..' '..t[2][3]

This function is included in the KNUTIL library.

release note


v0.3

  • changed to specify elements for table start and end, variable length arguments supported

v0.2

  • defaults to 1 or specifies the start of the table

v0.1

  • first release
P#59934 2022-09-12 09:27

[ :: Read More :: ]

Cart #knutil_join-1 | 2022-09-10 | Code ▽ | Embed ▽ | No License
2

Feature Overview

JOIN() Join strings with a delimiter.

  • Joins the argument strings with the specified delimiter.
  • This function consumes 25 Token.
?join('====','----','----','----','----\n')

?join(' ',unpack({'test','[join]','is','ok!\n\n'}))

?join('\fa◆\f6','c','o','m','p','l','e','t','e\n')

?join('\-e=\-e',unpack(split('----------------------------','')))

This function is included in the KNUTIL library.

release note


v0.2

  • variable argument support by tuple

v0.1

  • first release
P#59961 2022-09-10 15:45 ( Edited 2022-09-10 16:08)

[ :: Read More :: ]

Cart #knutil_ttable-2 | 2023-07-28 | Code ▽ | Embed ▽ | No License
1

Feature Overview

TTABLE() returns the table if the argument is a table.

  • Returns FALSE if not a table.
  • Use when table or string determination is required.
    • e.g., when using a string for initialization and replacing it with a table
    • Simultaneously check the type and reference the contents inline, as in type(tbl)=='table' and tbl.
  • This function consumes 10 Token.
tbl = '1 5 10' -- Default value.

tbl = ttable(tbl) or split(tbl, ' ') -- tbl = {1, 5, 10}

----
----

-- Thereafter, the tbl is not initialized even if there are changes to the elements of the tbl.
tbl = ttable(tbl) or split(tbl, ' ')

This function is included in the KNUTIL library.

release note


v0.2

  • table checking with count.
    v0.1
  • first release.
P#60009 2022-08-28 06:03 ( Edited 2023-07-28 13:32)

[ :: Read More :: ]

Cart #knutil_replace-1 | 2023-07-27 | Code ▽ | Embed ▽ | No License
6

Feature Overview

REPLACE() Replaces the specified string with the specified string.

  • The first argument string replaces all matches to the second argument string with the third argument string.
  • After the fourth and fifth words, you can further specify the search match and the words to be replaced.
  • This function consumes 58 Token.
--"str" becomes "string for replace".
str = replace('[test] for replace', '[test]', 'string') 

This function is included in the KNUTIL library.

release note


v0.2

  • multiple substitutions can be made with a single function call.

v0.1

  • first release

P#60157 2022-08-15 08:06 ( Edited 2023-07-27 14:36)

[ :: Read More :: ]

Cart #tuple_sum-0 | 2022-07-26 | Code ▽ | Embed ▽ | No License
3

Feature Overview

SUM() returns the sum of the numbers in the given arguments.

  • If the argument contains nil or false, the result will not be correct.
  • If too many arguments are given, Out of memory is returned. (In the sample, up to 710 arguments)
  • This function consumes 15 Token.

If you are concerned about some of the problems, consider using the "More Argments Ver" code.

--more argments ver(17 token)
function sum(a,...)
 foreach({...},function(v)
  a+=v
 end)
 return a
end

Other tuple trick code: INRNG()

P#63121 2022-07-26 09:26

[ :: Read More :: ]

[sfx]

This is one of the pieces of music played in my own game. ☺

P#63123 2022-07-08 02:19 ( Edited 2022-07-08 02:20)

[ :: Read More :: ]

Cart #knutil_inrng-2 | 2022-06-30 | Code ▽ | Embed ▽ | No License
1

Feature Overview

INRNG() Tests if the value is between the lowest and highest values.

  • Tests that the specified value is within a range.
  • This function consumes 10 Token.
--[true] in range value
inrng(5,1,10) 

--[true] lowest range value
inrng(1,1,10)

--[true] highest range value
inrng(10,1,10)

--[false] out of range value
inrng(0,1,10)

--Player:1 any key
inrng(btn(),0x1,0xff)

--Player:2 any key
inrng(btn(),0x100,0xff00)

This function is included in the KNUTIL library.

release note


v0.2

  • change arguments to a tuple

v0.1

  • first release

P#69481 2022-06-30 01:57 ( Edited 2022-12-27 06:00)

[ :: Read More :: ]

One-off characters [8 chars of raw binary data] print unnaturally.

Or I may not understand this feature.
I was aware that "\^.00000000" would print nothing.

P#71332 2022-04-17 12:38 ( Edited 2022-04-18 14:05)

[ :: Read More :: ]

Setting Tab stop controll code to 0 and outputting tab characters at the same time causes pico-8 crash.

pico-8 version:0.2.4b

print("\^s0\t")
P#72157 2022-04-05 13:53

[ :: Read More :: ]

Cart #rceach-0 | 2022-03-30 | Code ▽ | Embed ▽ | No License
1

Feature Overview

RCEACH() performs a two-dimensional loop in a single function.

  • The rectangle value arguments correspond to [table] {x,y,w,h} and [string] "x y w h".
  • You can refer to the current x and y values in the specified function.
  • This function consumes 50 Token.
rceach({16,16,32,32},function(x,y,r)
 local c=(x+y)%8+8
 pset(x,y,c)
end)

One of KNUTIL's functions, the object generated by EXRECT(), has a rectangle value format to be used for the RCEACH() argument.
may want to Use DMP() if check the converted table.
This function is included in the KNUTIL library.

P#72450 2022-03-30 10:32 ( Edited 2022-06-30 04:10)

[ :: Read More :: ]

Cart #tablemap-1 | 2023-05-28 | Code ▽ | Embed ▽ | No License
1

Feature Overview

TMAP(), like foreach(), applies the function of the second argument to each element of the table.

  • Usage is almost the same as foreach(), plus index values can be referenced within the function.
  • The specified table is returned. (TMAP() nested functions can be applied multiply)
  • The return value in the function specified in the argument can update each element of the table.
  • This function consumes 31 Token.
local t={
 'toast'
 ,'letus'
 ,'bacon'
 ,'cheese'
}
t=tmap(t, function(v,i)
 ?i..'..'..v
end)

--------

t=tmap(t, function(v,i)
 v='super★'..v
 ?i..'..'..v
 return v
end)

--------

t=tmap({
 'shield'
 ,'armor'
 ,'sword'
 ,'ring'
}, function(v,i)
 v=t[i]..'•'..v
 ?i..'..'..v
 return v
end)

may want to Use DMP() if check the converted table.
This function is included in the KNUTIL library.

release note


v0.2

  • support for updating table elements to false.
  • documentation was adapted to other library formats.
  • the previous version of the code was commented out as the shortest version.

v0.1

  • first release
P#77195 2022-03-21 08:51 ( Edited 2023-05-28 14:02)

[ :: Read More :: ]

Cart #combine_table-0 | 2022-03-15 | Code ▽ | Embed ▽ | No License
1

Feature Overview

COMB() combines two tables to create a hash table.

  • Returns the joined table.
  • The two arguments must be tables of index arrays.
  • The argument is nondestructive.
  • Hash tables are not in constant order. (This is a Lua specification.)
  • This function consumes 26 Token.
local keys={'name','species','home','skill'}
local values={'ruth','fox','port town','kon-psi'}

local charcter=comb(keys,values)

may want to Use DMP() if check the converted table.
This function is included in the KNUTIL library.

P#108664 2022-03-15 14:40

View Older Posts